package edu.hunau.cxb19.oop.class08.inner;

import org.junit.Test;

/**
 *
 * @author hb
 *
 *         2020-03-04 16:18:00
 */
public class InstanceInnerClass {
	private String datas = "from outer";
	private static int b = 200;

	/**
	 * 成员内部类
	 */
	public class InnerClass {
		private int a = 100;
		// 在成员内部类中不能出现静态的成员
		// private static String datas = "static field";

		public void call() {
			System.out.println("成员内部类#call..");
			System.out.println(datas);
			System.out.println(b);
		}
	}

	@Test
	public void test() {
		InstanceInnerClass outerClass = new InstanceInnerClass();
		InnerClass innerClass = outerClass.new InnerClass();
		innerClass.call();
	}

}
